﻿<Pages:AudioBasePage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                     xmlns:Pages="clr-namespace:Samples.Radio.Pages"
                     xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                     xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                     xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
                     mc:Ignorable="d"
                     d:DesignWidth="480"
                     d:DesignHeight="768"
                     DataContext="{Binding Program, Source={StaticResource Locator}}"
                     Style="{StaticResource TransitionPageStyle}"
                     x:Class="Samples.Radio.Pages.Program.ProgramPage"
                     >
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="Transparent"
          d:DataContext="{d:DesignData /SampleData/ProgramPageSampleData/ProgramPageSampleData.xaml}">
        <!--Pivot Control-->
        <controls:Pivot MinHeight="50"
					
                        Foreground="{StaticResource BrandColour1Brush}">
            <!--Pivot item one-->
            <controls:Pivot.Title>
                <StackPanel Orientation="Vertical"
                            DataContext="{Binding CurrentProgram}">
                    <TextBlock Text="{Binding ProgramName, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
                               Foreground="{StaticResource PhoneForegroundBrush}">

                    </TextBlock>
                    <TextBlock Text="{Binding ProgramSlogan}"
                               Opacity="0.66"
                               Foreground="{StaticResource PhoneForegroundBrush}" />
                </StackPanel>
            </controls:Pivot.Title>
            <controls:PivotItem Header="info"
                                DataContext="{Binding CurrentProgram}">
                <Grid>
                    <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Visible">
                        <StackPanel VerticalAlignment="Top"
                                    Width="456">
                            <TextBlock HorizontalAlignment="Left"
                                       TextWrapping="Wrap"
                                       Text="{Binding ProgramName, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
                                       Style="{StaticResource PhoneTextTitle2Style}"
                                       Margin="12,0,0,0">
							<TextBlock.Foreground>
								<SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
							</TextBlock.Foreground>
                            </TextBlock>
                            <TextBlock HorizontalAlignment="Left"
                                       TextWrapping="Wrap"
                                       Text="{Binding Schedule}"
                                       Style="{StaticResource PhoneTextTitle3Style}"
                                       Margin="12,0,12,24">
							<TextBlock.Foreground>
								<SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
							</TextBlock.Foreground>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap"
                                       Text="{Binding Description}"
                                       Style="{StaticResource PhoneTextNormalStyle}"
                                       Margin="12,0,12,24" />
                            <Image Source="{Binding ProgramImage}"
                                   VerticalAlignment="Top"
                                   Margin="12,0" />
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </controls:PivotItem>

            <!--Pivot item two-->
            <!--<controls:PivotItem Header="social" Visibility="Collapsed">
				<Grid Margin="12,0">
					<ListBox d:LayoutOverrides="Width" Margin="0" ItemTemplate="{StaticResource TweetsItemTemplate}" ItemsSource="{Binding Tweets}" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemContainerStyle="{StaticResource ListBoxItemContainerStyle}" HorizontalContentAlignment="Stretch"/>
				</Grid>
			</controls:PivotItem>-->
            <controls:PivotItem Header="podcasts">
                <Grid Margin="12,0">
                    <ListBox ItemTemplate="{StaticResource PodcastsItemTemplate}"
                             ItemsSource="{Binding CurrentProgram.Podcasts}"
                             toolkit:TiltEffect.IsTiltEnabled="True"
                             Margin="0"
                             HorizontalAlignment="Left"
                             VerticalAlignment="Top"
                             SelectedItem="{Binding SelectedPodcast, Mode=TwoWay}"
                             ItemsPanel="{StaticResource ListItemsPanelTemplate}"
                             ItemContainerStyle="{StaticResource ListBoxItemContainerStyle}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <ec:CallMethodAction TargetObject="{Binding}"
                                                     MethodName="AddSelectedPodcast" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>
</Pages:AudioBasePage>